import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/index',
      name: 'Index',
      component: () => import('@/views/Index'),
    },{
      path: '/',
      redirect:'/index',
    },{
      path: '/findpd',
      name: 'FindPd',
      component: () => import('@/views/FindPd'),
    },{
      path: '/updatePd',
      name: 'UpdatePd',
      component: () => import('@/views/UpdatePd'),
    },{
      path: '/hall',
      name: 'Hall',
      component: () => import('@/views/Hall'),
    },{
      path: '/userinfo',
      name: 'UserInfo',
      component: () => import('@/views/Userinfo'),
    },{
      path: '/feedback',
      name: 'Feedback',
      component: () => import('@/views/Feedback'),
    },{
      path: '/call',
      name: 'Call',
      component: () => import('@/views/Call'),
    },{
      path: '/score',
      name: 'Score',
      component: () => import('@/views/Score'),
    },{
      path: '/login',
      name: 'Login',
      component: () => import('@/views/admin/Login'),
    },{
      path: '/admin',
      name: 'Admin',
      meta: {
        requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
      },
      component: () => import('@/views/admin/Admin'),
			children : [
				{
				  path : '/movie',
				  name : 'Movie',
          meta: {
            requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
          },
				  component : ()=> import('@/views/admin/Movie')
				},
				{
				  path : '/classify',
				  name : 'Classify',
          meta: {
            requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
          },
				  component : ()=> import('@/views/admin/Classify')
				},
				{
				  path : '/comment',
				  name : 'Comment',
          meta: {
            requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
          },
				  component : ()=> import('@/views/admin/Comment')
				},
				{
				  path : '/grade',
				  name : 'Grade',
          meta: {
            requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
          },
				  component : ()=> import('@/views/admin/Grade')
				},
				{
				  path : '/user',
				  name : 'User',
          meta: {
            requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
          },
				  component : ()=> import('@/views/admin/User')
				},
        {
          path: '/role',
          name: 'Role',
          meta: {
            requireAuth: true,  // 添加该字段，表示进入这个路由是需要登录的
          },
          component : ()=> import('@/views/admin/Role')
        }
			],



    }
  ]
})
